package rkw.gui;

import org.eclipse.jface.wizard.Wizard;

import rkw.database.model.Node;
import core.database.NodeType;

public class WzdAddEditNode extends Wizard {

	private boolean addNode;
	private Node node;
	private NodeType[] nodeTypes;

	private WzdPgAddEditNode wzdPgAddEditNode;

	public WzdAddEditNode(boolean addNode, Node node, NodeType[] nodeTypes) {
		if (addNode) {
			setWindowTitle("Add Node");
		} else {
			setWindowTitle("Edit Node");
		}

		this.addNode = addNode;
		this.node = node;
		this.nodeTypes = nodeTypes;
	}

	@Override
	public void addPages() {
		wzdPgAddEditNode = new WzdPgAddEditNode(addNode, node, nodeTypes);
		addPage(wzdPgAddEditNode);
	}

	@Override
	public boolean performFinish() {
		wzdPgAddEditNode.update();

		return true;
	}

}
